package shop;

import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface IService<T> {

    @Transactional
    void create(T entity);

    @Transactional(readOnly = true)
    T read(Long id);

    @Transactional
    void update(T entity);

    @Transactional
    void delete(T entity);

    @Transactional(readOnly = true)
    List<T> readAll();

    @Transactional(readOnly = true)
    T findByField(String fieldName, Object value);
}
